#pragma once
#include <iostream>
#include <vector>
#include <ctime>
using namespace std;
 typedef void(*tt)();//函数指针
 void PrintLog()
{
    std::cout << "我是一个打印日志的任务" << std::endl;
}

void Download()
{
    std::cout << "我是一个下载的任务" << std::endl;
}

void Upload()
{
    std::cout << "我是一个上传的任务" << std::endl;
}

class task_set{

  public:
   task_set(){
     srand(time(0));
   }
      void Register(tt t){
          _ts.emplace_back(t);//构建任务数组
      }
      int getcode(){
        return rand()%_ts.size();
      }
      void Excute(int code){
        _ts[code]();
      }
      ~task_set(){}
  private:
   vector<tt> _ts;
};